<template>
  <div class="articleItem-container">
    <div class="article-wrapper">
      <div class="wrapper-more" v-if="article.cover.type === 3">
        <div class="article-title">{{ article.title }}</div>
        <div class="img-wrapper">
          <img
            :src="img"
            alt=""
            v-for="(img, index) in article.cover.images"
            :key="index"
          />
        </div>
      </div>
      <div class="wrapper-one" v-else-if="article.cover.type === 1">
        <div class="article-title">{{ article.title }}</div>
        <div class="img-wrapper">
          <img
            :src="img"
            alt=""
            v-for="(img, index) in article.cover.images"
            :key="index"
          />
        </div>
      </div>
      <div class="wrapper-none" v-else>
        <div class="article-title">{{ article.title }}</div>
        <div class="img-wrapper">
          <img
            :src="img"
            alt=""
            v-for="(img, index) in article.cover.images"
            :key="index"
          />
        </div>
      </div>
      <div class="article-bottom">
        <span>{{ article.aut_name }}</span>
        <span>{{ article.comm_count }}评论</span>
        <span>{{ article.pubdate | relativeTime }}</span>
        <span class="close" @click.stop="$emit('showReportPopup',article)">
          <van-icon size="12" color="#999" name="cross" />
        </span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: "ArticleItem",
  props: {
    article: {
      type: Object,
      require: true,
    },
  },
  data() {
    return {
    }
  },

  mounted() {},

  methods: {
  },
};
</script>

<style lang="less" scoped>
.articleItem-container {
  .article-wrapper {
    position: relative;
    box-sizing: border-box;
    width: 100%;
    padding: 0.26667rem 0.42667rem;
    overflow: hidden;
    color: #323233;
    font-size: 0.37333rem;
    line-height: 0.64rem;
    background-color: #fff;
    .wrapper-one{
        display: flex;
        justify-content: space-around;
        .article-title{
          flex: 1;
        }
        .img-wrapper{
            margin-left: 10px;
            flex: 1;
           img{
               width: 100%;
           }
        }
    }
    .wrapper-none{
        .img-wrapper{
            height: unset;
        }
    }
    .article-title {
      font-weight: 400;
      line-height: 0.58667rem;
      font-size: 0.42667rem;
      margin-bottom: 0.26667rem;
    }
    .img-wrapper {
      width: 100%;
      height: 80px;
      img {
        width: 32%;
        height: 100%;
      }
      img:nth-child(n + 2) {
        margin-left: 5px;
      }
    }
    .article-bottom {
      display: flex;
      justify-content: flex-start;
      margin-top: 10px;
      span {
        color: #999;
        line-height: 0.58667rem;
        // position: relative;
        font-size: 0.32rem;
      }
      span:nth-child(n + 2) {
        margin-left: 10px;
      }
      .close{
        position: absolute;
        right: 16px;
      }
    }
  }
}
</style>